/*
 * Written by Anders Fongen
 * Norwegian Defence Research Establishment (FFI)
 * Email: anders@fongen.no
 */
package no.ffi.tpm.crypto;


import java.io.Serializable;
import javax.crypto.SecretKey;

public class EncryptedObject implements Serializable {
     public String algId; //The algorithm used for the asymmetric encryption
    public int sessKeyPrefix;//The amount of bytes to remove to get the session key
    public byte[] encryptedBuffer; //The symmetrically encrypted data
    public byte[] encryptedKey;//The session key encrypted with algId
    public transient SecretKey secretKey;
    
    public EncryptedObject(String algId,int preamble,byte[] encryptedBuffer, byte[] encryptedKey, SecretKey secretKey) {
        this.algId=algId;
        this.sessKeyPrefix=preamble;
        this.encryptedBuffer = encryptedBuffer;
        this.encryptedKey = encryptedKey;
        this.secretKey = secretKey;
    }

}    
